package io.renren.modules.areainfos.service.impl;

import io.renren.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import io.renren.modules.areainfos.dao.AreainfosDao;
import io.renren.modules.areainfos.entity.AreainfosEntity;
import io.renren.modules.areainfos.service.AreainfosService;



/**
 * @author 杨帅
 */
@Service("areainfosService")
public class AreainfosServiceImpl implements AreainfosService {
	@Autowired
	private AreainfosDao areainfosDao;

	@Override
	public String queryAreaidByColumnId(String columnId) {
		return areainfosDao.queryAreaidByColumnId(columnId);
	}

	@Override
	public R isExistArea(Integer columnid) {
		int existArea = areainfosDao.isExistArea(columnid);
		if(existArea == 0){
			return R.error("地区不存在");
		}
		return null;
	}

	@Override
	public AreainfosEntity queryObject(Integer columnid){
		return areainfosDao.queryObject(columnid);
	}
	
	@Override
	public List<AreainfosEntity> queryList(Map<String, Object> map){
		return areainfosDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return areainfosDao.queryTotal(map);
	}
	
	@Override
	public void save(AreainfosEntity areainfos){
		areainfosDao.save(areainfos);
	}
	
	@Override
	public void update(AreainfosEntity areainfos){
		areainfosDao.update(areainfos);
	}
	
	@Override
	public void delete(Integer columnid){
		areainfosDao.delete(columnid);
	}
	
	@Override
	public void deleteBatch(Integer[] columnids){
		areainfosDao.deleteBatch(columnids);
	}

	@Override
	public List<AreainfosEntity> queryNotPagerList() {
		return areainfosDao.queryNotPagerList();
	}

	@Override
	public int isParentNode(Integer columnid) {
		return areainfosDao.isParentNode(columnid);
	}

	@Override
	public List<AreainfosEntity> apiQueryByParentId(Integer parentid) {
		return areainfosDao.apiQueryByParentId(parentid);
	}

	@Override
	public List<AreainfosEntity> queryByParentId(Integer parentid) {
		return areainfosDao.queryByParentId(parentid);
	}


}
